﻿CREATE TABLE [dbo].[Agente] (
    [AgenteId]         INT           IDENTITY (1, 1) NOT NULL,
    [Dni]              VARCHAR (10)  NOT NULL,
    [Nombre]           VARCHAR (50)  NOT NULL,
    [Apellido]         VARCHAR (50)  NOT NULL,
    [Activo]           BIT           DEFAULT ((1)) NOT NULL,
    [FechaBaja]		   DATE      NULL,
    [AreaId]           INT           NOT NULL,
    [CargoId]          INT           NOT NULL,
    [PuestoId]         INT           NOT NULL,
    [Telefono]         VARCHAR (50)  NOT NULL,
    [Domicilio]        VARCHAR (100) NOT NULL,
    CONSTRAINT [PK_Agente] PRIMARY KEY CLUSTERED ([AgenteId] ASC) WITH (FILLFACTOR = 80),
    CONSTRAINT [FK_Agente_Area] FOREIGN KEY ([AreaId]) REFERENCES [dbo].[Area] ([AreaId]),
    CONSTRAINT [FK_Agente_Cargo] FOREIGN KEY ([CargoId]) REFERENCES [dbo].[Cargo] ([CargoId]),
    CONSTRAINT [FK_Agente_Puesto] FOREIGN KEY ([PuestoId]) REFERENCES [dbo].[Puesto] ([PuestoId])
);
